grep -P "^(\d{3}-|\(\d{3}\) )\d{3}-\d{4}$" file.txt
